package org.example.day20240907;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    public static void main(String[] args) throws ParseException {
        String date1 = "2024-09-01";
        String date2 = "2024-10-01";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(simpleDateFormat.parse(date1));

        while (!simpleDateFormat.format(calendar.getTime()).equals(date2)){
            System.out.println(simpleDateFormat.format(calendar.getTime()));
            calendar.add(Calendar.DATE,1);
        }
        System.out.println(date2);
    }
}
